<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>

<body>
    <div id='app'>
        {{msg}}
        =======
        <father :aa='msg' :bb='msg2'></father>
        <hr>
        <father2 :cc='msg' :dd='msg2'></father2>
    </div>
    <script type='text/javascript'>

    /* 全局组件 */
        var obj = {
            template: `<h1>我是father组件==={{aa}}===={{bb}}</h1>`,
            props: ['aa', 'bb']
        }
        Vue.component('father', obj)


        /* 私有组件传值 */

        var son2={
            template:`<span>我是son2 ,而且还是father2的儿子======{{tt}}==</span>`,
            props:['tt']
        }

        var  father2 = {
            data(){
                return {
                    ff2:'我是father2组件中的值'
                }
            },
            template: `<h2>我是father2组件=={{cc}}===={{dd}}===
            
                ==================
                <s2 :tt='ff2'></s2>
            </h2>`,
            props:['cc','dd'],
            components:{
                s2:son2
            }
        }

        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue',
                msg2: 'second'
            },
            components:{
                father2:father2
            }
        })

    </script>
</body>

</html>